/*
 *
 *  Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see http://www.gnu.org/licenses/. 
 *
 *  Author : Raúl Román López <rroman@gsyc.es>
 *
 */

package com.LibreGeoSocial.App;

import java.util.HashMap;

public class DataManager{
	
	public static final String GENERIC_LAYER = "GENERIC_LAYER";
	public static final String LAYER_CATEGORIES = "LAYER_CATEGORIES";
	public static final String RESOURCES_LIST = "RESOURCES_LIST";
	
	private static HashMap<String, Object> mMemory;
	private static DataManager singleton = null;
	
	public static DataManager getInstance(){
		if(singleton == null)
			singleton = new DataManager();
		return singleton;
	}
	
	public void putData(String key, Object value){
		if(mMemory == null)
			mMemory = new HashMap<String, Object>();
		mMemory.put(key, value);
	}
	
	public Object getData(String key){
		if(mMemory == null)
			return null;
		return mMemory.get(key);
	}
	
	public Object removeData(String key){
		if(mMemory == null)
			return null;
		return mMemory.remove(key);
	}
	
}